package com.ship.dispatch.service;

import com.github.pagehelper.PageInfo;
import com.ship.common.business.service.BaseService;
import com.ship.common.core.web.domain.JsonResult;
import com.ship.dispatch.bean.ConResourceMemorandum;
import com.ship.dispatch.bean.IshShipBaseExtend;
import com.ship.dispatch.bean.SpInformation;
import com.ship.dispatch.bean.SpQualifications;
import com.ship.dispatch.bean.boats.QueryBoatsBaseRq;
import com.ship.dispatch.bean.boats.info.QueryBoatsPortSisterInfo;
import com.ship.dispatch.bean.boats.info.QueryShipMessageInfo;
import com.ship.dispatch.bean.treaShipNetwork.IhsShipBase;
import com.ship.dispatch.bean.treaShipNetwork.IhsShipBaseDetailVO;
import com.ship.dispatch.bean.treaShipNetwork.IhsShipBaseList;
import com.ship.dispatch.bean.treaShipNetwork.IhsShipBaseSelVo;
import com.ship.dispatch.bo.*;
import com.ship.dispatch.model.ShipQueryModel;
import com.ship.dispatch.vo.PortVo;
import com.ship.dispatch.vo.SpOverhaulVo;
import com.ship.dispatch.vo.VirtualShipVO;
import com.ship.system.api.domain.dispatch.SimpleShipInfoVo;
import org.springframework.web.multipart.MultipartFile;

import java.beans.IntrospectionException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 船舶信息 服务类
 * </p>
 *
 * @author AbyssRabbit@163.com
 * @since 2023-10-18
 */
public interface SpInformationService extends BaseService<SpInformation> {

    /**
     * 根据条件获取船舶
     * @param shipQueryModel
     * @return
     */
    List<SpInformation> getShips(ShipQueryModel shipQueryModel);

    /**
     * 获取船旗国
     * @return
     */
    List<String> getFlagStates();

    /**
     * 获取港口信息
     * @return
     */
    List<PortVo> getPort();

    /**
     * 获取资源合同
     * @return
     */
    List<ConResourceMemorandum> getCon();

    /**
     * 船运合同中拉取所有满足条件的船舶
     * @return
     */
    List<SpInformation> getAllSpInformationUsed(Integer year);

    /**
     * 船运合同中拉取所有满足条件的船舶（前在投标）
     * @return
     */
    List<SpInformation> getAllSpInformationUsedPotential();

    /**
     * 获取可用船只信息
     * @param date
     * @return
     */
    Map<String,List<SpInformation>> getConSpInformation(Date date);

    /**
     * 添加虚拟船(调度优化)
     * @param virtualShipBO
     */
    SpInformation saveOptimizeVirtualShip(VirtualShipOptimizeBO virtualShipBO);

    /**
     * 添加通用虚拟船
     */
    SpInformation createVirtualSpInformation();

    JsonResult<IhsShipBaseList> getListInfo(IhsShipBaseSelVo ihsShipBase);

    Object getQueryCriteria();

    List<IhsShipBaseDetailVO> getShipInfoDetail(String imo) throws IntrospectionException;

    String export(SpOverhaulVo spOverhaulVo) throws IOException;

    Object upload(MultipartFile file,String imo);

    List<Map<String,Object>> getFromB(String imo);

    String getShipInfoDetailTime(String imo);

    List<QueryBoatsPortSisterInfo> queryBoatsSister(QueryBoatsBaseRq queryBoatsBaseRq);

    List<QueryBoatsPortSisterInfo> exportBoatsPortSisterList(QueryBoatsBaseRq queryBoatsBaseRq);

    List<QueryShipMessageInfo> queryShipMessageAll();

    List<PortTreeSelect> getPortTree();

    String queryMmsiByShipName(String shipName, String imo);

    List<QueryShipMessageInfo> queryShipMessage(String queryType, String queryValue);

    SpInformation queryShipImoByShipName(String vesselName);

    boolean createShipBaseExtend(Map<String, List<IshShipBaseExtend>> map);

    IshShipBaseExtend queryShipMessageInteriorByImo(String imo);

    PageInfo<IshShipBaseExtend> queryUnderConstructionPage(Integer pageNum, Integer pageSize);

    boolean deleteFromBById(List<String> ids);

    JsonResult virtualAdd(VirtualShipAddBo bo);

    JsonResult virtualUpdate(VirtualShipAddBo bo);

    JsonResult virtualRent(ShipRentUpdateBo bo);

    IhsShipBaseList queryShipBaseByShipName(String shipName,String imo);

    List<SimpleShipInfoVo> getAllSimpleShipList();
}
